<?php

namespace Wilead\IArtistBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Wilead\IArtistBundle\Repository\UserSkillRepository")
 * @UniqueEntity({"skill", "User"})
 */
class UserSkill {

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     * @Assert\NotBlank()
     */
    private $skill;

    /**
     * @ORM\ManyToOne(targetEntity="User", inversedBy="UserSkills")
     * @ORM\JoinColumn(name="userId", referencedColumnName="id", nullable=false)
     * */
    private $User;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set skill
     *
     * @param string $skill
     * @return UserSkill
     */
    public function setSkill($skill) {
        $this->skill = $skill;

        return $this;
    }

    /**
     * Get skill
     *
     * @return string 
     */
    public function getSkill() {
        return $this->skill;
    }

    /**
     * Set User
     *
     * @param \Wilead\IArtistBundle\Entity\User $user
     * @return UserSkill
     */
    public function setUser(\Wilead\IArtistBundle\Entity\User $user = null) {
        $this->User = $user;

        return $this;
    }

    /**
     * Get User
     *
     * @return \Wilead\IArtistBundle\Entity\User 
     */
    public function getUser() {
        return $this->User;
    }

}